<div class="organization-manager">
  <div class="organization-manager-title">
     <span>
       组织管理
     </span>
  </div>
  <div class="organization-manager-header">
    <div class="organization-manager-search">
      <div class="ui-inputgroup" >
        <input type="text" pInputText  placeholder="搜索" [(ngModel)]="organizationName"/>
        <button pButton type="button" icon="pi pi-search" class="ui-button-warn" (click)="searchDataClick()"></button>
      </div>
    </div>
    <div class="organization-manager-button">
      <button pButton type="button" label="添加组织" class="ui-button-rounded" (click)="showAddOrgazitionClick()"></button>
      <button pButton type="button" label="批量删除" class="ui-button-rounded" (click)="delOrgazitionInfoClick()"></button>
    </div>
  </div>
  <div class="organization-manager-table">
    <app-check-table-btn [select]="orgazitionSelect"   (selectData)="selectData($event)" [option]="optionTable" (detail)="DetailClick($event)"></app-check-table-btn>
  </div>
  <div class="organization-manager-pagination">
    <app-pagination [option]="pageOption" (clickEvent)="clickEvent($event)"></app-pagination>
  </div>
<!--  <p-toast position="top-center" key="toast"></p-toast>-->
<!--  <p-confirmDialog header="Confirmation" acceptLabel="取消" rejectLabel="确认选择" acceptIcon="" rejectIcon=""></p-confirmDialog>-->
  <p-dialog header="信息添加" [(visible)]="showAddOrgazationDialog" [style]="{width: '700px'}">
    <form [formGroup]="addOragization">
      <div class="ui-g ui-md ui-fiuld">
        <div class="ui-g-12 ui-md-12">
          <div class="ui-g-2 ui-md-2"></div>
          <div class="ui-g-8 ui-md-8" style="line-height: 4.4vh">
            <div class="ui-g-4 ui-md-4 right">
              <span style="color: #FF8A9A">*</span>组织名称：
            </div>
            <div class="ui-g-8 ui-md-8 ">
              <div class="ui-md-12 ui-g-12 dialog-input">
                <input pInputText type="text" formControlName="organizationName" placeholder="请输入组织名称"/>
              </div>
            </div>
          </div>
         <div class="ui-g-12 ui-md-12">
           <div class="ui-g-2 ui-md-2"></div>
           <div class="ui-g-8 ui-md-8" style="line-height: 4.4vh">
             <div class="ui-g-4 ui-md-4 right">
               <span style="color: #FF8A9A">*</span>父级组织：
             </div>
             <div class="ui-g-8 ui-md-8 ">
               <div class="ui-md-12 ui-g-12 dialog-input">
                 <input pInputText type="text" formControlName="name" placeholder="请选择父级组织" (click)="this.treeDialog = true"/>
               </div>
             </div>
           </div>
         </div>
        </div>
      </div>
    </form>
    <p-footer>
      <button class="dialog-btn" (click)="showAddOrgazationDialog = false;resetAllData()">取消</button>
      <button class="dialog-btn" (click)="addOragizationInfoClick()">确认选择</button>
    </p-footer>
  </p-dialog>
  <p-dialog header="信息编辑" [(visible)]="showEditOrgazationDialog" [style]="{width: '700px'}">
    <form [formGroup]="addOragization">
      <div class="ui-g ui-md ui-fiuld">
        <div class="ui-g-12 ui-md-12">
          <div class="ui-g-2 ui-md-2"></div>
          <div class="ui-g-8 ui-md-8" style="line-height: 4.4vh">
            <div class="ui-g-4 ui-md-4 right">
              <span style="color: #FF8A9A">*</span>组织名称：
            </div>
            <div class="ui-g-8 ui-md-8 ">
              <div class="ui-md-12 ui-g-12 dialog-input">
                <input pInputText type="text" formControlName="organizationName" placeholder="请输入组织名称"/>
              </div>
            </div>
          </div>
          <div class="ui-g-12 ui-md-12">
            <div class="ui-g-2 ui-md-2"></div>
            <div class="ui-g-8 ui-md-8" style="line-height: 4.4vh">
              <div class="ui-g-4 ui-md-4 right">
                <span style="color: #FF8A9A">*</span>父级组织：
              </div>
              <div class="ui-g-8 ui-md-8 ">
                <div class="ui-md-12 ui-g-12 dialog-input">
                  <input pInputText type="text" formControlName="name" placeholder="请选择父级组织" (click)="this.treeDialog = true"/>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </form>
    <p-footer>
      <button class="dialog-btn" (click)="showEditOrgazationDialog = false;resetAllData()">取消</button>
      <button class="dialog-btn" (click)="updateOragizationInfoClick()">确认选择</button>
    </p-footer>
  </p-dialog>

  <!--组织树结构-->
  <p-dialog [(visible)]="treeDialog" [responsive]="true" showEffect="fade" [modal]= false [maximizable]="false" [baseZIndex]="10000" [modal]="true" [width]="350" [height]="400">
    <div class="ui-g ui-fluid">
      <div class="ui-g-12">
        <p-scrollPanel [style]="{width: '100%', height: '250px'}">
          <p-tree
            [value]="dataTrees"
            [(selection)]="dataTree"
            selectionMode="single">
          </p-tree>
        </p-scrollPanel>
      </div>
    </div>
    <p-footer>
      <button  style="width: 4vw;padding: 4px 0"  (click)="treeDialog = false">取消</button>
      <button  style="width: 6vw;border: 0;color: #fff;padding: 4px 0"   (click)="dataTreeSureClick()" >确认选择</button>
    </p-footer>
  </p-dialog>
</div>
